﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
namespace NGinnBPM.Runtime.Messages
{
    /// <summary>
    /// Information that a task has failed.
    /// No response is expected.
    /// </summary>
    [Serializable]
    [DataContract]
    public class TaskFailed : TaskStatusChanged
    {
        public TaskFailed() { }
        public TaskFailed(string sourceInstance, string parentInstance, string processInstance, string errorInfo)
        {
            SourceTaskInstanceId = sourceInstance;
            ParentTaskInstanceId = parentInstance;
            ProcessInstanceId = processInstance;
            ErrorInfo = ErrorInfo;
        }
        [DataMember]
        public string ErrorInfo { get; set; }

        /// <summary>True if failure is expected and should not lead to an alert</summary>
        [DataMember]
        public bool IsExpected { get; set; }
    }
}
